<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/CMS.Master" Inherits="Shop.Framework.Page.CMS_ProductImage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <script src="/Scripts/cmsCategory.js" type="text/javascript" language="javascript"></script>
    <style type="text/css">    
    ul.image-list{
        list-style:none;
        padding:0;
        margin: 0 auto;
        width:350px;
    }ul.image-list li{
        display:inline;
        padding-left:5px;
        padding-right:5px;
        width:30%;
    }ul.image-list li img{
        height:120px;
    }            
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2><%=ProductItem.Name %> Images</h2>
    
    <%if(ImageList.Count != 0){ %>
        <ul class="image-list">
            <% foreach(var item in ImageList){%>
                <li>
                    <form action="/cms/maintainance/modify-props/<%=item.IdProduct %>/<%=item.IdProductImage %>" method="post"> 
                        <img src="/ProductImages/<%=item.Name %>" alt="<%=item.Name %>" id="product" width="100px"/>
                        <input type="submit" name="Delete" value="Delete"/>
                        <input type="submit" name="Default" value="Default"/>
                    </form>
                </li>
            <%} %>
        </ul>
    <%} %>
    
    <form name="upload-image" enctype="multipart/form-data" method="post" action="/cms/maintainance/addProduct-image/<%=ProductItem.IdProduct %> ">
        Get image location: <input type="file" name="image-file" accept="image/gif,image/jpeg,image/png" />
        <input type="submit" name="submit" value="Upload image"/>
    </form>        
    <div class="clear"></div>    
    <a onclick="history.go(-1)" class="nav_link">Back to previous</a>
</asp:Content>
